package com.xiaohai.big_event_system.service.impl;

import com.xiaohai.big_event_system.projo.User;
import com.xiaohai.big_event_system.mapper.UserMapper;
import com.xiaohai.big_event_system.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaohai.big_event_system.utils.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author author
 * @since 2025-01-15
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByUserName(String username) {
        return userMapper.findByUserName(username);
    }

    @Override
    public void register(String username, String password) {
        String s = Md5Util.getMD5String(password);
        userMapper.add(username,s);
    }
}
